//package com.tuyou.cloud.stream.kafka.partition;
//
//import org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy;
//import org.springframework.messaging.Message;
//import org.springframework.stereotype.Component;
//
//@Component
//public class MyPartitionKeyExtractor implements PartitionKeyExtractorStrategy {
//    @Override
//    public Object extractKey(Message<?> message) {
//        System.out.println("MyPartitionKeyExtractor...");
//
//        if (message.getPayload() instanceof String) {
//            String payload = (String) message.getPayload();
//            return payload.length();
//        }
//        return null;
//    }
//}
